import request from '@/utils/request'
// 树状图
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 新增ajax
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 删除ajax
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
// 展示编辑部门详情内容ajax
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 提交修改ajax
export function deDepartDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
